#include <iostream>
#include <cstring>
#include <algorithm>
#include <list>

using namespace std;
#include "list.h"

void list_splice()
{
	list<int>mylist1, mylist2;

	for (int i = 1; i <= 4; i++) mylist1.push_back(i);
	for (int i = 1; i <= 4; i++) mylist2.push_back(i * 10);
	std::list<int>::iterator it1 = mylist1.begin();
	it1++;

	mylist1.splice(it1, mylist2);  // 转移mylist2到it1位置之前
	// 注意：此时链表2就为空链表了 所以splice名字叫做转移

	for (auto& e : mylist1)
	{
		cout << e << " ";
	}
}

int main()
{
	// list_splice();

	bit::test1();
	bit::test_list2();

	return 0;
}